package com.yanqu.road.entity.activity.washe.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.activity.washe.config.WasheConfig;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 锦标赛玩家数据
 */
@FieldTypeAnnotation(tableName = "t_u_washe_user_jinbiao")
public class WasheUserJinBiaoData extends DataObject {

    @FieldTypeAnnotation(desc = "玩家ID", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "赛季，初始-1")
    private int dataSeason = WasheConfig.SEASON_ID_NULL;

    @FieldTypeAnnotation(desc = "锦标赛积分")
    private long score;
    @FieldTypeAnnotation(desc = "积分赛体力")
    private int energy;

    @FieldTypeAnnotation(desc = "连胜次数")
    private int continueWinTimes;

    @FieldTypeAnnotation(desc = "每日重置时间")
    private long dayResetTime;

    @FieldTypeAnnotation(desc = "巅峰赛胜场")
    private int peakWinTimes;

    @FieldTypeAnnotation(desc = "巅峰赛积分")
    private long peakScore;

    @FieldTypeAnnotation(desc = "积分赛阶段性已领取的奖励")
    private List<Integer> hadRewardStageList = new ArrayList<>();

    @FieldTypeAnnotation(desc = "各赛季最终锦标赛分数")
    private ConcurrentHashMap<Integer, Long> seasonScoreMap = new ConcurrentHashMap<>();
    @FieldTypeAnnotation(desc = "各赛季最高锦标赛分数")
    private ConcurrentHashMap<Integer, Long> seasonTopScoreMap = new ConcurrentHashMap<>();


    // ========================================================================

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getDataSeason() {
        return dataSeason;
    }

    public void setDataSeason(int dataSeason) {
        if (this.dataSeason != dataSeason) {
            this.dataSeason = dataSeason;
            setOp(DataStatus.Update);
        }
    }

    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        if (this.score != score) {
            this.score = score;
            setOp(DataStatus.Update);
        }
    }

    public int getEnergy() {
        return energy;
    }

    public void setEnergy(int energy) {
        if (this.energy != energy) {
            this.energy = energy;
            setOp(DataStatus.Update);
        }
    }

    public int getContinueWinTimes() {
        return continueWinTimes;
    }

    public void setContinueWinTimes(int continueWinTimes) {
        if (this.continueWinTimes != continueWinTimes) {
            this.continueWinTimes = continueWinTimes;
            setOp(DataStatus.Update);
        }
    }

    public long getDayResetTime() {
        return dayResetTime;
    }

    public void setDayResetTime(long dayResetTime) {
        if (this.dayResetTime != dayResetTime) {
            this.dayResetTime = dayResetTime;
            setOp(DataStatus.Update);
        }
    }

    public int getPeakWinTimes() {
        return peakWinTimes;
    }

    public void setPeakWinTimes(int peakWinTimes) {
        if (this.peakWinTimes != peakWinTimes) {
            this.peakWinTimes = peakWinTimes;
            setOp(DataStatus.Update);
        }
    }

    public long getPeakScore() {
        return peakScore;
    }

    public void setPeakScore(long peakScore) {
        if (this.peakScore != peakScore) {
            this.peakScore = peakScore;
            setOp(DataStatus.Update);
        }
    }

    public List<Integer> getHadRewardStageList() {
        return hadRewardStageList;
    }

    public void setHadRewardStageList(List<Integer> hadRewardStageList) {
        if (hadRewardStageList == null) {
            return;
        }
        this.hadRewardStageList = hadRewardStageList;
        setOp(DataStatus.Update);
    }

    public ConcurrentHashMap<Integer, Long> getSeasonScoreMap() {
        return seasonScoreMap;
    }

    public void setSeasonScoreMap(ConcurrentHashMap<Integer, Long> seasonScoreMap) {
        if (seasonScoreMap != null) {
            this.seasonScoreMap = seasonScoreMap;
            setUpdateOption();
        }
    }

    public ConcurrentHashMap<Integer, Long> getSeasonTopScoreMap() {
        return seasonTopScoreMap;
    }

    public void setSeasonTopScoreMap(ConcurrentHashMap<Integer, Long> seasonTopScoreMap) {
        if (seasonTopScoreMap != null) {
            this.seasonTopScoreMap = seasonTopScoreMap;
            setUpdateOption();
        }
    }
}
